package cn.Y_Qiu.basic.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;

public class EmailUtil {
    @Autowired
    private static JavaMailSender javaMailSender;

    public static void sendemail(String setTo,String title, String sendcontent){
        SimpleMailMessage mailMessage = new SimpleMailMessage();
        //设置发送人
        mailMessage.setFrom("15676147696@163.com");
        //邮件主题
        mailMessage.setSubject("title");
        //邮件内容
        mailMessage.setText("sendcontent");
        //收件人
        mailMessage.setTo(setTo);
        javaMailSender.send(mailMessage);
    }

}
